package com.hongxin.nw.netty.model.analysis.info;

import com.hongxin.nw.netty.utils.FieldAnalysis;
import io.netty.buffer.ByteBuf;
import lombok.extern.slf4j.Slf4j;

/**
 * @remark 表A.1.2非车载直流充电机（整车）充电过程实时监测数据
 * @author: GuoXiaolin
 * @date 2019/6/11 15:51
 * @Version 1.0
 * @Descibe
 */


@Slf4j
public class Mjcna1_2  {

    private String b1;//1	充电机编号	132：M_MD_NA_1	压缩BCD码	8Byte	充电机编号
    private String b2;//2	充电接口标识	1：M_SP_NA_1	BIN码	1Byte	充电设备为一桩多充时用来标记接口号，一桩一充时此项为0。多个接口时顺序对每个接口进行编号
    private String b3;//3	充电机输出电压	11：M_ME_NB_1	BIN码	2Byte	精确到小数点后一位
    private String b4;//4	充电机输出电流	11：M_ME_NB_1	BIN码	2Byte	精确到小数点后二位
    private String b5;//5	SOC	11：M_ME_NB_1	BIN码	2Byte	整型
    private String b6;//6	电池组最低温度	11：M_ME_NB_1	BIN码	2Byte	精确到小数点后一位
    private String b7;//7	电池组最高温度	11：M_ME_NB_1	BIN码	2Byte	精确到小数点后一位
    private String b8;//8	充电机状态	11：M_ME_NB_1	压缩BCD码	2Byte	0001-告警0002-待机0003-工作 0004-离线 0005-完成
    private String b9;//9	BMS通信异常	1：M_SP_NA_1	BIN码	1Byte	布尔型, 变化上传；0正常，1异常
    private String b10;//10	直流母线输出过压告警	1：M_SP_NA_1	BIN码	1Byte	布尔型, 变化上传；0：不过压，1过压
    private String b11;//11	直流母线输出欠压告警	1：M_SP_NA_1	BIN码	1Byte	布尔型, 变化上传；0：不欠压，1欠压
    private String b12;//12	蓄电池充电过流告警	1：M_SP_NA_1	BIN码	1Byte	布尔型, 变化上传；0：不过流，1过流
    private String b13;//13	蓄电池模块采样点过温告警	1：M_SP_NA_1	BIN码	1Byte	布尔型, 变化上传；0：不过温，1过温
    private String b14;//14	直流有功总电度	132：M_MD_NA_1	BIN码	4Byte	精确到小数点后一位
    private String b15;//15	交流有功总电度	132：M_MD_NA_1	BIN码	4Byte	精确到小数点后一位
    private String b16;//16	是否连接电池	1：M_SP_NA_1	BIN码	1Byte	布尔型, 变化上传
    private String b17;//17	单体电池最高电压	11：M_ME_NB_1	BIN码	2Byte	精确到小数点后三位
    private String b18;//18	单体电池最低电压	11：M_ME_NB_1	BIN码	2Byte	精确到小数点后三位
    private String b19;//19	充电机连接器故障	1：M_SP_NA_1	BIN码	1Byte	布尔型, 变化上传，1故障
    private String b20;//20	BMS终止	1：M_SP_NA_1	BIN码	1Byte	布尔型, 变化上传，1终止
    private String b21;//21	充电机内部温度故障	1：M_SP_NA_1	BIN码	1Byte	布尔型, 变化上传，1故障
    private String b22;//22	温度过高保护	1：M_SP_NA_1	BIN码	1Byte	布尔型, 变化上传，1过高
    private String b23;//23	短路保护	1：M_SP_NA_1	BIN码	1Byte	布尔型, 变化上传，1发生
    private String b24;//24	漏电保护	1：M_SP_NA_1	BIN码	1Byte	布尔型, 变化上传，1发生
    private String b25;//25	急停开关触发	1：M_SP_NA_1	BIN码	1Byte	布尔型, 变化上传，1触发
    private String b26;//26	充电机输入电压	11：M_ME_NB_1	BIN码	2Byte	精确到小数点后一位
    private String b27;//27	充电机输入过压告警	1：M_SP_NA_1	BIN码	1Byte	布尔型, 变化上传，1触发
    private String b28;//28	充电机输入欠压告警	1：M_SP_NA_1	BIN码	1Byte	布尔型, 变化上传，1触发
    private String b29;//29	（当前）A相电压	11：M_ME_NB_1	BIN码	2Byte	精确到小数点后一位
    private String b30;//30	（当前）B相电压	11：M_ME_NB_1	BIN码	2Byte	精确到小数点后一位
    private String b31;//31	（当前）C相电压	11：M_ME_NB_1	BIN码	2Byte	精确到小数点后一位
    private String b32;//32	（当前）A相电流	11：M_ME_NB_1	BIN码	2Byte	精确到小数点后二位
    private String b33;//33	（当前）B相电流	11：M_ME_NB_1	BIN码	2Byte	精确到小数点后二位
    private String b34;//34	（当前）C相电流	11：M_ME_NB_1	BIN码	2Byte	精确到小数点后二位

    private int idx = 0;
    private ByteBuf byteBuf;

    public void subB1() {
        //this.b1 = this.substring(TypeIdentif.BYTE_JC_B1.getByteLength());
        //this.b1 = FieldAnalysis.analysisBCD(this.b1);
    }

    public void subB2() {
       //this.b2 = this.substring(TypeIdentif.BYTE_JC_B2.getByteLength());
       //this.b2 = FieldAnalysis.analysisBin(this.b2);
    }

    public void subB3() {
       //this.b3 =  this.substring(TypeIdentif.BYTE_JC_B3.getByteLength());
       //this.b3 = FieldAnalysis.hexToDecimal(this.b3,1);
    }

    public void subB4() {
       //this.b4 =  this.substring(TypeIdentif.BYTE_JC_B4.getByteLength());
       //this.b4 = FieldAnalysis.hexToDecimal(this.b4,2);
    }

    public void subB5() {
       //this.b5 =  this.substring(TypeIdentif.BYTE_JC_B5.getByteLength());
       //this.b5 = FieldAnalysis.analysisBin(this.b5);
    }

    public void subB6() {
       //this.b6 =  this.substring(TypeIdentif.BYTE_JC_B6.getByteLength());
       //this.b6 = FieldAnalysis.hexToDecimal(this.b6,1);
    }

    public void subB7() {
       //this.b7 =  this.substring(TypeIdentif.BYTE_JC_B7.getByteLength());
       //this.b7 = FieldAnalysis.hexToDecimal(this.b7,1);
    }

    public void subB8() {
       //this.b8 =  this.substring(TypeIdentif.BYTE_JC_B8.getByteLength());
       //this.b8 = FieldAnalysis.analysisBCD(this.b8);
    }

    public void subB9() {
       //this.b9 =  this.substring(TypeIdentif.BYTE_JC_B9.getByteLength());
       //this.b9 = FieldAnalysis.analysisBin(this.b9);
    }

    public void subB10() {
       //this.b10 =  this.substring(TypeIdentif.BYTE_JC_B10.getByteLength());
       //this.b10 = FieldAnalysis.analysisBin(this.b10);
    }

    public void subB11() {
       //this.b11 =  this.substring(TypeIdentif.BYTE_JC_B11.getByteLength());
       //this.b11 = FieldAnalysis.analysisBin(this.b11);
    }

    public void subB12() {
       //this.b12 =  this.substring(TypeIdentif.BYTE_JC_B12.getByteLength());
       //this.b12 = FieldAnalysis.analysisBin(this.b12);
    }

    public void subB13() {
       //this.b13 =  this.substring(TypeIdentif.BYTE_JC_B13.getByteLength());
       //this.b13 = FieldAnalysis.analysisBin(this.b13);
    }

    public void subB14() {
       //this.b14 =  this.substring(TypeIdentif.BYTE_JC_B14.getByteLength());
       //this.b14 = FieldAnalysis.hexToDecimal(this.b14,1);
    }

    public void subB15() {
       //this.b15 =  this.substring(TypeIdentif.BYTE_JC_B15.getByteLength());
       //this.b15 = FieldAnalysis.hexToDecimal(this.b15,1);
    }

    public void subB16() {
       //this.b16 =  this.substring(TypeIdentif.BYTE_JC_B16.getByteLength());
       //this.b16 = FieldAnalysis.analysisBin(this.b16);
    }

    public void subB17() {
       //this.b17 =  this.substring(TypeIdentif.BYTE_JC_B17.getByteLength());
       //this.b17 = FieldAnalysis.hexToDecimal(this.b17,3);
    }

    public void subB18() {
       //this.b18 =  this.substring(TypeIdentif.BYTE_JC_B18.getByteLength());
       //this.b18 = FieldAnalysis.hexToDecimal(this.b18,3);
    }

    public void subB19() {
       //this.b19 =  this.substring(TypeIdentif.BYTE_JC_B19.getByteLength());
       //this.b19 = FieldAnalysis.analysisBin(this.b19);
    }

    public void subB20() {
       //this.b20 =  this.substring(TypeIdentif.BYTE_JC_B20.getByteLength());
       //this.b20 = FieldAnalysis.analysisBin(this.b20);
    }

    public void subB21() {
       //this.b21 =  this.substring(TypeIdentif.BYTE_JC_B21.getByteLength());
       //this.b21 = FieldAnalysis.analysisBin(this.b21);
    }

    public void subB22() {
       //this.b22 =  this.substring(TypeIdentif.BYTE_JC_B22.getByteLength());
       //this.b22 = FieldAnalysis.analysisBin(this.b22);
    }

    public void subB23() {
       //this.b23 =  this.substring(TypeIdentif.BYTE_JC_B23.getByteLength());
       //this.b23 = FieldAnalysis.analysisBin(this.b23);
    }

    public void subB24() {
       //this.b24 =  this.substring(TypeIdentif.BYTE_JC_B24.getByteLength());
       //this.b24 = FieldAnalysis.analysisBin(this.b24);
    }

    public void subB25() {
       //this.b25 =  this.substring(TypeIdentif.BYTE_JC_B25.getByteLength());
       //this.b25 = FieldAnalysis.analysisBin(this.b25);
    }

    public void subB26() {
       //this.b26 =  this.substring(TypeIdentif.BYTE_JC_B26.getByteLength());
       //this.b26 = FieldAnalysis.hexToDecimal(this.b26,1);
    }

    public void subB27() {
       //this.b27 =  this.substring(TypeIdentif.BYTE_JC_B27.getByteLength());
       //this.b27 = FieldAnalysis.analysisBin(this.b27);
    }

    public void subB28() {
       //this.b28 =  substring(TypeIdentif.BYTE_JC_B28.getByteLength());
       //this.b28 = FieldAnalysis.analysisBin(this.b28);
    }

    public void subB29() {
       //this.b29 =  substring(TypeIdentif.BYTE_JC_B29.getByteLength());
       //this.b29 = FieldAnalysis.hexToDecimal(this.b29, 1);
    }

    public void subB30() {
       //this.b30 =  substring(TypeIdentif.BYTE_JC_B30.getByteLength());
       //this.b30 = FieldAnalysis.hexToDecimal(this.b30, 1);
    }

    public void subB31() {
       //this.b31 =  substring(TypeIdentif.BYTE_JC_B31.getByteLength());
       //this.b31 = FieldAnalysis.hexToDecimal(this.b31, 1);
    }

    public void subB32() {
       //this.b32 =  substring(TypeIdentif.BYTE_JC_B32.getByteLength());
       //this.b32 = FieldAnalysis.hexToDecimal(this.b32, 2);
    }

    public void subB33() {
       //this.b33 =  substring(TypeIdentif.BYTE_JC_B33.getByteLength());
       //this.b33 = FieldAnalysis.hexToDecimal(this.b33, 2);
    }

    public void subB34() {
       //this.b34 =  substring(TypeIdentif.BYTE_JC_B34.getByteLength());
        this.b34 = FieldAnalysis.hexToDecimal(this.b34, 2);
    }

    public Mjcna1_2 analysisStr(int idx, ByteBuf byteBuf) {
        this.idx = idx;
        this.byteBuf = byteBuf;
        subB1();
        subB2();
        subB3();
        subB4();
        subB5();
        subB6();
        subB7();
        subB8();
        subB9();
        subB10();
        subB11();
        subB12();
        subB13();
        subB14();
        subB15();
        subB16();
        subB17();
        subB18();
        subB19();
        subB20();
        subB21();
        subB22();
        subB23();
        subB24();
        subB25();
        subB26();
        subB27();
        subB28();
        subB29();
        subB30();
        subB31();
        subB32();
        subB33();
        subB34();
        log.info(toString());
        return this;
    }

    @Override
    public String toString() {
        return "Mjcna1_2{" +
                "b1='" + b1 + '\'' +
                ", b2='" + b2 + '\'' +
                ", b3='" + b3 + '\'' +
                ", b4='" + b4 + '\'' +
                ", b5='" + b5 + '\'' +
                ", b6='" + b6 + '\'' +
                ", b7='" + b7 + '\'' +
                ", b8='" + b8 + '\'' +
                ", b9='" + b9 + '\'' +
                ", b10='" + b10 + '\'' +
                ", b11='" + b11 + '\'' +
                ", b12='" + b12 + '\'' +
                ", b13='" + b13 + '\'' +
                ", b14='" + b14 + '\'' +
                ", b15='" + b15 + '\'' +
                ", b16='" + b16 + '\'' +
                ", b17='" + b17 + '\'' +
                ", b18='" + b18 + '\'' +
                ", b19='" + b19 + '\'' +
                ", b20='" + b20 + '\'' +
                ", b21='" + b21 + '\'' +
                ", b22='" + b22 + '\'' +
                ", b23='" + b23 + '\'' +
                ", b24='" + b24 + '\'' +
                ", b25='" + b25 + '\'' +
                ", b26='" + b26 + '\'' +
                ", b27='" + b27 + '\'' +
                ", b28='" + b28 + '\'' +
                ", b29='" + b29 + '\'' +
                ", b30='" + b30 + '\'' +
                ", b31='" + b31 + '\'' +
                ", b32='" + b32 + '\'' +
                ", b33='" + b33 + '\'' +
                ", b34='" + b34 + '\'' +
                '}';
    }
}
